package com.fr71.project.dm.service.impl;

import com.fr71.common.utils.DateUtils;
import com.fr71.project.dm.domain.PdChangeLog;
import com.fr71.project.dm.mapper.PdChangeLogMapper;
import com.fr71.project.dm.service.IPdChangeLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 开发者：https://github.com/devzwy
 * 创建时间：2023-07-07
 * 类描述：换绑记录Service业务层处理
 */
@Service
public class PdChangeLogServiceImpl implements IPdChangeLogService {
    
    @Autowired
    private PdChangeLogMapper pdChangeLogMapper;

    /**
     * 查询换绑记录
     * 
     * @param id 换绑记录主键
     * @return 换绑记录
     */
    @Override
    public PdChangeLog selectPdChangeLogById(Long id) {
        return pdChangeLogMapper.selectPdChangeLogById(id);
    }

    /**
     * 查询换绑记录列表
     * 
     * @param pdChangeLog 换绑记录
     * @return 换绑记录
     */
    @Override
    public List<PdChangeLog> selectPdChangeLogList(PdChangeLog pdChangeLog) {
        return pdChangeLogMapper.selectPdChangeLogList(pdChangeLog);
    }

    /**
     * 新增换绑记录
     * 
     * @param pdChangeLog 换绑记录
     * @return 结果
     */
    @Override
    public int insertPdChangeLog(PdChangeLog pdChangeLog) {
        pdChangeLog.setCreateTime(DateUtils.getNowDate());
        return pdChangeLogMapper.insertPdChangeLog(pdChangeLog);
    }

    /**
     * 修改换绑记录
     * 
     * @param pdChangeLog 换绑记录
     * @return 结果
     */
    @Override
    public int updatePdChangeLog(PdChangeLog pdChangeLog) {
        pdChangeLog.setUpdateTime(DateUtils.getNowDate());
        return pdChangeLogMapper.updatePdChangeLog(pdChangeLog);
    }

    /**
     * 批量删除换绑记录
     * 
     * @param ids 需要删除的换绑记录主键
     * @return 结果
     */
    @Override
    public int deletePdChangeLogByIds(Long[] ids) {
        return pdChangeLogMapper.deletePdChangeLogByIds(ids);
    }

    /**
     * 删除换绑记录信息
     * 
     * @param id 换绑记录主键
     * @return 结果
     */
    @Override
    public int deletePdChangeLogById(Long id) {
        return pdChangeLogMapper.deletePdChangeLogById(id);
    }
}